﻿using System;

namespace Progream13
{
    class Program
    {
        //const是静态常量，所以在编译的时候就将a与b的值确定下来了
        //static readonly是动态常量，常量的值在编译期间不解析，所以开始都是默认值，x与y都是int类型，故都是0，
        //而程序执行到x=Y*10，所以x=0*10=0，程序接着执行到y=10这句时候，才会真正的y的初值10赋给y
        static void Main(string[] args)
        {
            ////变量
            //var number = 10;
            //number = 20;
            //Console.WriteLine("输出变量number:" + number);

            ////常量，在程序运行中不能改变的
            //var number1 = 50;
            //Console.WriteLine("输出常量number1:" + number1);
            ////常量不能进行赋值
            ///


            const int B = 10;
            const int A = B * 10;
            Console.WriteLine("A is {0},B is {1}", A, B);

            Console.WriteLine("X is {0},Y is {1}", X, Y);
        }
        static readonly int X=Y*10;
        static readonly int Y = 10;
    }
}
